﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WaferImage
{

    public class Gray
    {
        private float grayAve;  //平均灰度值
        private float gray1;    //区域1灰度值
        private float gray2;
        private float gray3;
        private float gray4;
        private float gray5;
        private float gray6;
        private float gray7;
        private float gray8;
        private float gray9;
        
        

        public Gray()
        {
            grayAve = 0;
            gray1 = 0;
            gray2 = 0;
            gray3 = 0;
            gray4 = 0;
            gray5 = 0;
            gray6 = 0;
            gray7 = 0;
            gray8 = 0;
            gray9 = 0;           
        }

        [DisplayName("平均灰度值"), Description("平均灰度值")]
        public float GrayAve
        {
            get { return grayAve; }
            set { grayAve = value; }
        }

        [DisplayName("区域1灰度值"), Description("区域1灰度值")]
        public float Gray1
        {
            get { return gray1; }
            set { gray1 = value; }
        }

        [DisplayName("区域2灰度值"), Description("区域2灰度值")]
        public float Gray2
        {
            get { return gray2; }
            set { gray2 = value; }
        }

        [DisplayName("区域3灰度值"), Description("区域3灰度值")]
        public float Gray3
        {
            get { return gray3; }
            set { gray3 = value; }
        }
        [DisplayName("区域4灰度值"), Description("区域4灰度值")]
        public float Gray4
        {
            get { return gray4; }
            set { gray4 = value; }
        }
        [DisplayName("区域5灰度值"), Description("区域5灰度值")]
        public float Gray5
        {
            get { return gray5; }
            set { gray5 = value; }
        }
        [DisplayName("区域6灰度值"), Description("区域6灰度值")]
        public float Gray6
        {
            get { return gray6; }
            set { gray6 = value; }
        }
        [DisplayName("区域7灰度值"), Description("区域7灰度值")]
        public float Gray7
        {
            get { return gray7; }
            set { gray7 = value; }
        }
        [DisplayName("区域8灰度值"), Description("区域8灰度值")]
        public float Gray8
        {
            get { return gray8; }
            set { gray8 = value; }
        }
        [DisplayName("区域9灰度值"), Description("区域9灰度值")]
        public float Gray9
        {
            get { return gray9; }
            set { gray9 = value; }
        }

        [Browsable(false)]
        public float[] Temp
        {
            get { return GetValue(); }
            
        } 
        private float[] GetValue()
        {
             float[] temp = new float[10];
             temp[0] = GrayAve;
             temp[1] = gray1;
             temp[2] = gray2;
             temp[3] = gray3;
             temp[4] = gray4;
             temp[5] = gray5;
             temp[6] = gray6;
             temp[7] = gray7;
             temp[8] = gray8;
             temp[9] = gray9;
            return temp;
        }

        
        public override string ToString()
        {
            return "";
        }
    }
}
